From: Paul Eggert Date: Mon, 18 Apr 2011 04:16:47 +0000 (-0700) Subject: * alloc.c (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~4024^2~53 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=cc686ac473fc4e9c6afe4f6c58a22268c8396ac7;p=emacs.git * alloc.c (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that can cause Emacs to crash when string overrun checking is enabled. --- diff --git a/src/ChangeLog b/src/ChangeLog index 732fc15611f..da9f90afe02 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,6 +4,8 @@ This doesn't fix a bug but makes the code clearer. (string_overrun_cookie): Now const. Use initializers that don't formally overflow signed char, to avoid warnings. + (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that + can cause Emacs to crash when string overrun checking is enabled. 2011-04-17 Chong Yidong diff --git a/src/alloc.c b/src/alloc.c index 2029383dec8..2af75e3c471 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1937,7 +1937,8 @@ allocate_string_data (struct Lisp_String *s, s->size_byte = nbytes; s->data[nbytes] = '\0'; #ifdef GC_CHECK_STRING_OVERRUN - memcpy (data + needed, string_overrun_cookie, GC_STRING_OVERRUN_COOKIE_SIZE); + memcpy ((char *) data + needed, string_overrun_cookie, + GC_STRING_OVERRUN_COOKIE_SIZE); #endif /* If S had already data assigned, mark that as free by setting its